<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function c1(){
				var d=document.getElementById("D1");
				//d.innerHTML="<img src='../images/book-01.jpg'>";
				var g=document.createElement("img");
				g.setAttribute("src","../images/book-01.jpg");
				
				d.appendChild(g);
			}
			function dellast(){
				var d=document.getElementById("D1");
				var i=d.lastElementChild;
				d.removeChild(i);
			}//remove
			function kelong(){
				var d=document.getElementById("D1");
				var d2=d.cloneNode(true);
				document.body.appendChild(d2);
			}
		</script>
	</head>
	<body>
		<div id="D1" style="border: 1px solid red;"></div>
		<input type="button" value="Create" onclick="c1()"/>
		<input type="button" value="删除最后一张图片" onclick="dellast()"/>
		
		<input type="button" value="克隆整个div" onclick="kelong()"/>
	</body>
</html>
